<?php
namespace Home\Controller;
use Think\Controller;
class ContactUsController extends Controller {
    public function index(){
    	$banner=M('banner');
        $bannerlist=$banner->select();
        $this->assign("bannerlist",$bannerlist);
        $this->display();
    }
   	public function addComment(){
        $data['content']=$_POST['content'];
    	$data['name']=$_COOKIE['enrollusername'];
    	$data['contact']=$_POST['contact'];
    	$data['time']=date("Y-m-d H:i:s");
    	$comment=M('comment');
		if($comment->add($data)){
			// $this->redirect('ContactUs/index');
			$this->success("评论成功",U('ContactUs/index'));
		}else{
			$this->error();
		}
    }
}